﻿using ProtoBuf.Message;
using System;
using System.Collections.Generic;
using Dict.DataModel;
using Dict.Blo;
using UnityEngine;

namespace UI
{
    /// <summary>
    /// 碎片
    /// </summary>
    public class UIFragItem
    {
        public TableFrag fragData;

        public long num;


        public UIFragItem(TableFrag data)
        {
            fragData = data;
            num = 0;
        }

        public UIFragItem(SimpleItem data)
        {
            fragData = DictFragBlo.GetTableFrag(data.id);
            if (fragData == null)
            {
                Debug.LogError("Treasure Frag " + data.id + " not content");
                BoxManager.CreatePopupTextBox("Treasure Frag " + data.id + " not content");
            }
            this.num = data.num;
        }

        public UIFragItem(string treaId)
        {
            fragData = DictFragBlo.GetTableFrag(treaId);
            num = 0;
        }

    }
}
